import matplotlib.pyplot as plt
import numpy as np

plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False

labels = ['A', 'B', 'C', 'D', 'E']
sizes = [15, 30, 25, 10, 20]

explode = (0.05, 0, 0, 0, 0)
plt.figure(figsize=(10, 6))
plt.pie(sizes, explode=explode, labels=labels, autopct="%.1f%%", shadow=True, startangle=90, wedgeprops=dict(width=0.5))
plt.title('饼图示例')
plt.axis()  # 横纵比
plt.show()
